package com.lxy.u4day0501.controller;

import com.lxy.u4day0501.entity.User;
import com.lxy.u4day0501.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class HtmlController {

    @Autowired
    private UserService userService;

    @RequestMapping("/goHtml")
    public String goHtml(Model model){
        List<User> list = userService.list(null);
        model.addAttribute("list",list);
        System.out.println("????????????????");
        return "User";
    }
}
